<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../0_assets/js/mustache.min.js"></script>
</head>
<body>
    <div class="root"></div>
    <script>
        let root = document.querySelector('.root');
        let data = {
            flag:true
        };  
        // 注意，mustache不是vue的模板语法，双大括号里不能写表达式
        let templateStr = `
        {{#flag}}
            <h1>flag是${data.flag}所以我能显示</h1>
        {{/flag}}
        `;
        root.innerHTML = mustache.render(templateStr,data)
    </script>
</body>
</html>